import request from '@/utils/request'
import {download} from '@/utils/request'
import {getNowDate} from '@/utils/tools.js'


// 分页获取用户列表
export function getUserList(params) {
  return request({
    url: '/system/acddUser/list',
    method: 'get',
    params
  })
}

// 根据ids查询用户
export function getUserListByIds(ids) {
  return request({
    url: `/system/acddUser/acddUserIds?ids=${ids}`,
    method: 'get',
  })
}


// 新建用户
export function addUser(data) {
  return request({
    url: '/system/acddUser/add',
    method: 'POST',
    data
  })
}

// 修改用户
export function editUser(data) {
  return request({
    url: '/system/acddUser/edit',
    method: 'post',
    data
  })
}

// 用户查询(查看)
export function getUserDetail(id) {
  return request({
    url: `/system/acddUser/getInfo/${id}`,
    method: 'GET'
  })
}


// 删除用户
export function delUser(ids) {
  return request({
    url: `/system/acddUser/remove/${ids}`,
    method: 'post'
  })
}

// 导出用户
export function exportUser(params, filename) {
  return download(
    '/system/acddUser/export', 
    params, 
    `${filename}${getNowDate()}.xlsx`
  )
}

// 导入用户 system/acddUser/importUser
// export function exportUser(params, filename) {
//   return download(
//     '/system/acddUser/export', 
//     params, 
//     `${filename}${getNowDate()}.xlsx`
//   )
// }